<?php
namespace app\ausadmin\controller;
use think\Request;
use think\Db;
use think\Session;
use think\Cookie;
use think\Controller;
use think\Config;

class Common extends Controller
{
	public function _initialize(){
		if(!session('adminusername')){
          // $this->error('您尚未登录系统',url('login/index'));
          $this->redirect(\think\Request::instance()->root().'/ausadmin/Login/index');
        }
	}

	public function lang() {
        switch ($_GET['lang']) {
            case 'cn':
                cookie('think_var', 'zh-cn');
                break;
            case 'en':
                cookie('think_var', 'en-us');
                break;
            //其它语言
        }
    }
}	



